
package com.cptravel.adapter;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.cptravel.activity.index.IndexOneFragment;
import com.cptravel.bean.IndexPics;

public class IndexPagerAdapter extends FragmentPagerAdapter
{
    public List<IndexPics> pics = new ArrayList<IndexPics>();

    public IndexPagerAdapter(FragmentManager fm)
    {
        super(fm);
        // TODO Auto-generated constructor stub
    }

    @Override
    public Fragment getItem(int arg0)
    {
        // TODO Auto-generated method stub
        IndexOneFragment indexOneFragment = new IndexOneFragment();
        Bundle bundle = new Bundle();
        bundle.putSerializable("pic", pics.get(arg0));
        indexOneFragment.setArguments(bundle);
        return indexOneFragment;
    }

    @Override
    public int getCount()
    {
        // TODO Auto-generated method stub
        return pics.size();
    }
}
